{include file='public:header-css'/}
<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        {include file='public:left-menu'/}
        <!--End 左侧导航-->
        <!--头部信息-->
        {include file='public:nav-header' title="会员管理" subTitle="会员详情"/}
        <!--End 头部信息-->
        <!--页面主要内容-->
        <main class="lyear-layout-content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-body">
                                <form method="post" id="submit-form" class="row">
                                    <div class="form-group col-md-12">
                                        <div class="row">
                                            <div class="col-md-6">
                                                <label class="form-title"><em class="require">*</em>手机号码</label>
                                                <div class="input-group">
                                                    <input type="text" class="form-control" value="{$user.mobile}" placeholder="请输入手机号码" name="mobile">
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default fuzhi" type="button" data-text="{$user.mobile}">复制</button>
                                                    </span>
                                                </div>
                                                <span class="error" id="err_mobile"></span>
                                            </div>
                                            <div class="col-md-6">
                                                <label class="form-title"><em class="require">*</em>推荐人账号</label>
                                                <div class="input-group">
                                                    {if $user.reid}
                                                    <input type="text" class="form-control" value="{$user.reid|getMobile}" placeholder="请输入推荐人账号" name="remobile">
                                                    {else/}
                                                    <input type="text" class="form-control" value="" placeholder="请输入推荐人账号" name="remobile">
                                                    {/if}
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default fuzhi" type="button" data-text="{$user.reid|getMobile}">复制</button>
                                                    </span>
                                                </div>
                                                <span class="error" id="err_remobile"></span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <div class="row">
                                            <div class="col-md-6">
                                                <label class="form-title"><em class="require">*</em>微信昵称</label>
                                                <div class="input-group">
                                                    <input type="text" placeholder="请输入微信昵称" value="{$user.wechat_name}" name="wechat_name" class="form-control"/>
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default fuzhi" type="button" data-text="{$user.wechat_name|default='未完善'}">复制</button>
                                                    </span>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <label class="form-title"><em class="require">*</em>微信账号</label>
                                                <div class="input-group">
                                                    <input type="text" placeholder="请输入微信账号" value="{$user.wechat_account}" name="wechat_account" class="form-control"/>
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default fuzhi" type="button" data-text="{$user.wechat_account|default='未完善'}">复制</button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <div class="row">
                                            <div class="col-md-6">
                                                <label class="form-title"><em class="require">*</em>支付宝姓名</label>
                                                <div class="input-group">
                                                    <input type="text" placeholder="请输入支付宝姓名" value="{$user.realname}" name="realname" class="form-control"/>
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default fuzhi" type="button" data-text="{$user.realname|default='未完善'}">复制</button>
                                                    </span>
                                                </div>
                                            </div>
                                            <div class="col-md-6">
                                                <label class="form-title"><em class="require">*</em>支付宝账号</label>
                                                <div class="input-group">
                                                    <input type="text" placeholder="请输入支付宝账号" value="{$user.zhifubao}" name="zhifubao" class="form-control"/>
                                                    <span class="input-group-btn">
                                                        <button class="btn btn-default fuzhi" type="button" data-text="{$user.zhifubao|default='未完善'}">复制</button>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <div class="row">
                                            <div class="col-md-6">
                                                <label class="form-title">直推总人数</label>
                                                <input type="text" value="{$user.zt_all_num}" class="form-control" disabled/>
                                            </div>
                                            <div class="col-md-6">
                                                <label class="form-title">团队总人数</label>
                                                <input type="text" value="{$user.td_all_num}" class="form-control" disabled/>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <div class="row">
                                            <div class="col-md-4">
                                                <label class="form-title">累积认养金额</label>
                                                <input type="text" value="{$user.lj_ry_yeji}" class="form-control" disabled/>
                                            </div>
                                            <div class="col-md-4">
                                                <label class="form-title">日认养金额</label>
                                                <input type="text" value="{$user.day_ry_yeji}" class="form-control" disabled/>
                                            </div>
                                            <div class="col-md-4">
                                                <label class="form-title">月认养金额</label>
                                                <input type="text" value="{$user.month_ry_yeji}" class="form-control" disabled/>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <div class="row">
                                            <div class="col-md-4">
                                                <label class="form-title">日团队认养金额</label>
                                                <input type="text" value="{$user.day_td_ry_yeji}" class="form-control" disabled/>
                                            </div>
                                            <div class="col-md-4">
                                                <label class="form-title">月团队认养金额</label>
                                                <input type="text" value="{$user.td_month_yeji}" class="form-control" disabled/>
                                            </div>
                                            <div class="col-md-4">
                                                <label class="form-title">团队认养金额</label>
                                                <input type="text" value="{$user.td_ry_yeji}" class="form-control" disabled/>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <div class="row">
                                            <div class="col-md-4">
                                                <label class="form-title">累积消费</label>
                                                <input type="text" value="{$user.lj_xf}" class="form-control" disabled/>
                                            </div>
                                            <div class="col-md-4">
                                                <label class="form-title">累积收益</label>
                                                <input type="text" value="{$user.lj_sy}" class="form-control" disabled/>
                                            </div>
                                            <div class="col-md-4">
                                                <label class="form-title">会员等级</label>
                                                <select style="display: block;width: 100%;" class="input-group-select" name="level">
                                                    {volist name="$level_list" id="level"}
                                                    <option value="{$level.level_id}" {if $level.level_id==$user.level}selected{/if}>{$level.name}</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <div class="row">
                                            <div class="col-md-6">
                                                <label>是否封号</label>
                                                <div class="btn-group form-group-toggle">
                                                    <label class="radio-btn radio-theme {if $user.is_lock==1}active{/if}">
                                                        <input type="radio" name="is_lock" value="1" {if $user.is_lock==1}checked{/if}>
                                                        <i class="mdi mdi-checkbox-marked-circle-outline"> 是</i>
                                                    </label>
                                                    <label class="radio-btn radio-default {if $user.is_lock==0}active{/if}">
                                                        <input type="radio" name="is_lock" value="0" {if $user.is_lock==0}checked{/if}>
                                                        <i class="mdi mdi-close-circle-outline"> 否</i> </label>
                                                </div>
                                                <span class="help">封号后将不能登录 操作资金等 请谨慎操作</span>
                                            </div>
                                            <div class="col-md-6">
                                                <label class="form-title">会员资金</label>
                                                <div class="input-group">
                                                    <div class="form-inline">
                                                        <div class="item">
                                                            <span>粮票</span>
                                                            <span>{$user.user_money}</span>
                                                        </div>
                                                        <div class="item">
                                                            <span>积分</span>
                                                            <span>{$user.jifen}</span>
                                                        </div>
                                                        <div class="item">
                                                            <span>牧场补贴</span>
                                                            <span>{$user.mcbt}</span>
                                                        </div>
                                                        <div class="item">
                                                            <span>储备金</span>
                                                            <span>{$user.reserve_money}</span>
                                                        </div>
                                                        <a class="btn btn-sm btn-theme" style="border-radius: 3px" href="{:url('User/account_edit',['user_id'=>$user[$user.pk]])}">
                                                            <i class="mdi mdi-pencil"></i>
                                                            资金调节
                                                        </a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group col-md-12">
                                        <div class="row">
                                            <div class="col-md-6">
                                                <label class="form-title">新密码</label>
                                                <input type="password" class="form-control" name="password"
                                                       placeholder="请输入新密码"/>
                                                <span class="help">留空表示不修改密码</span>
                                            </div>
                                            <div class="col-md-6">
                                                <label class="form-title">确认密码</label>
                                                <input type="password" class="form-control" name="conpassword"
                                                       placeholder="请输入确认密码"/>
                                                <span class="help">留空表示不修改密码</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-12">
                                        <button type="button" class="btn-theme submit-btn">确定</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
        <!--End 页面主要内容-->
    </div>
</div>
<style>
    .form-inline .item {
        margin-right: 5px;
    }

    .form-inline .item span:last-child {
        color: var(--red);
    }
</style>
<script type="text/javascript" src="__STATIC__/js/clipboard.js"></script>
<script type="text/javascript">
    $(function () {
        $('.submit-btn').click(function () {
            var url = "{:url('User/detail',[$user.pk=>$user[$user.pk]])}";
            var data = $('#submit-form').serialize();
            public_ajax(url, data, function (data) {
                if (data.code == 1) {
                    showSuccessMsg(data.msg, function () {
                        if (data.data.url) {
                            location.href = data.data.url;
                        }
                    });
                } else {
                    showErrorMsg(data.msg);
                }
            });
        });
    });
    var clipboard = new ClipboardJS('.fuzhi', {
        text: function (e) {
            var text = $(e).attr('data-text');
            return text;
        }
    });
    clipboard.on('success', function (e) {
        showSuccessMsg('复制成功');
    });
    clipboard.on('error', function (e) {
        showErrorMsg('复制失败');
    });
</script>
</body>
</html>
